<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sb" uri="/struts-bootstrap-tags"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加大类</title>
<script type="text/javascript">
function checkName(){
	var supId=$("#supId").val();
	var supName=$("#supName").val();
	if(supName==null||supName==""){
		 $("#nameError").text("大类名称不能为空");
		}
	$.ajax({
		type:'get',
		url:'supType_checkName',
		data:{supId:supId,supName:supName},
		dataType:'json',
		 success: function(data){
            //alert(data.msg);
	            $("#nameError").text(data[0].msg);
			 }
		});
}
</script>
</head>
<body>
<s:form action="supType_saveSupType" method="post" theme="simple" id="save">
  <s:hidden name="supType.supId"  value='%{supType.supId}' id="supId"></s:hidden>
  <s:hidden name="supType.created"  value='%{supType.created}'></s:hidden>
  <s:hidden name="supType.createId"  value='%{supType.createId}'></s:hidden>
<table>
<tr>
<td style="width: 110px;">大类名称:</td>
<td>
<s:textfield name="supType.supName" required="true"  id="supName" onmouseout="checkName()" placeholder="请输入大类名称" value="%{supType.supName}"></s:textfield>
</td>
<td id="nameError" ></td>
</tr>
</table>

</s:form>
</body>
</html>